
// <copyright file="AbstractMethodInformation.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The abstract method information.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Reflection.CodeSerialization
{
    using System;
    using System.Reflection;

    /// <summary>
    /// The abstract method information.
    /// </summary>
    [Serializable]
    public abstract class AbstractMethodInformation
    {
        #region Properties

        /// <summary>
        /// Gets or sets the parameter types.
        /// </summary>
        internal string[] ParameterTypes { get; set; }

        #endregion Properties

        #region Methods

        /// <summary>
        /// The populate method base information.
        /// </summary>
        /// <param name="method">
        /// The method.
        /// </param>
        /// <param name="info">
        /// The info.
        /// </param>
        internal static void PopulateMethodBaseInformation(MethodBase method, AbstractMethodInformation info)
        {
            ParameterInfo[] parameters = method.GetParameters();
            info.ParameterTypes = new string[parameters.Length];
            for (int i = 0; i < parameters.Length; i++)
            {
                info.ParameterTypes[i] = parameters[i].ParameterType.AssemblyQualifiedName;
            }
        }

        #endregion Methods
    }
}
